<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>订单验证</title>
	<!--引入bottstrapCss****/-->
	<link rel="stylesheet" type="text/css" href="{{__ROOT__}}/resource/home/bt/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="{{__ROOT__}}/resource/home/css/index.css" />
	<!--引入bottstrapJS***/-->
	<script src="{{__ROOT__}}/resource/home/js/jquery.11.min.js"></script>
	<script src="{{__ROOT__}}/resource/home/bt/js/bootstrap.min.js"></script>
	<script src="{{__ROOT__}}/resource/home/js/index.js"></script>
	<script src="{{__ROOT__}}/resource/home/js/area.js"></script>
	<script src="{{__ROOT__}}/resource/home/laydate/laydate.js"></script>
</head>

<body>
<!--顶部导航-->
<div id="top">
	<div class="left">
		<ul class="class">

			<li class="class"><span>品牌官网</span><b>|</b></li>
			<li class="class"> <span>炫耀官网</span><b>|</b></li>

			<li class="class"><span>花粉俱乐部</span><b>|</b></li>
			<li class="class"><span31iyu>Select Regoin</span31iyu></li>
		</ul>
	</div>
	<div class="right">
		<ul>
			<?php if($_SESSION['homeUser']['uid']){?>
				<li>
					<a href="{{u('myCenter.index')}}">我的订单</a>

				</li>
				<span>|</span>
				<li>

					<span> <strong > 欢迎:</strong><a href="">{{$_SESSION['homeUser']['uname']}}</a> </span>&nbsp;|

					<strong><a href="{{u('user.del')}}" > 退出 </a></strong>
				</li>
			<?php }else{?>

				<li>
					<strong><a href="{{u('user.login')}}" >登录</a></strong>&nbsp;
					<strong><a href="{{u('user.register')}}" >注册 </a></strong>

				</li>
			<?php }?>
			<span>|</span>
			<li>
				<span>V码（优购码)</span>&nbsp;

			</li>
			<span>|</span>
			<li>
				<span>手机版</span>&nbsp;

			</li>


		</ul>
	</div>
</div>
<!--顶部灰条结束-->
<!--***********************子类继承开始*****************************-->
<div class="header">
	<div class="shopping">
		<!--logo开始-->
		<div class="logo">
			<a href="{{u('entry.index')}}">
				<img src="{{__ROOT__}}/resource/home/images/logo3.png" alt="" />
			</a>
		</div>

		<!--logo 结束***8右侧不继承自己自编辑-->
		<div class="list_header_right">
			<!--我的购物车 流程条-->
			<!--<div class="list_header_right_Mycar"> 我的购物车</div>-->
			<div class="list_header_right_checkOrder"> 填写核对订单</div>
			<!--<div class="list_header_right_successOrder">成功递交订单</div>-->

		</div>
	</div>
</div>
<!--SC********************************子类继承**************888-->
<div class="orde_main">
	<!--摸态框-->
	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<h4 class="modal-title" id="myModalLabel">请添加地址</h4>
				</div>
				<!--主体from表单-->
				<form class="form-horizontal" role="form" method="post" >
					<div class="modal-body">

						<div class="form-group">
							<label for="inputEmail3" class="col-sm-2 control-label">*收货人：</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" name="ressName" id="inputEmail3" placeholder="请输入姓名">
							</div>
						</div>
						<!--收货地址-->
						<script>
							$(function(){
								//初始化
								area.init('area');
								//默认选中
								area.selected("广东","广州","从化市");
							})
						</script>
						<div class="form-group">
							<label for="inputPassword3" class="col-sm-2 control-label">*收获地址</label>
							<div class="col-sm-10">
								<span>城市联动:</span>
								<select name="bigRess[]" id="area1"></select>
								<select name="bigRess[]" id="area2"></select>
								<select name="bigRess[]" id="area3"></select>
								<!--详细地址 文本域-->
								<input  class="form-control"type="text" name="detailRess" placeholder="请输入详细地址">

							</div>
						</div>
						<!--邮编-->
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-2 control-label">邮编：</label>
							<div class="col-sm-10">
								<input type="text" name="postcode" class="form-control" id="inputEmail3" placeholder="请输邮编">
							</div>
						</div>
						<!--手机号-->
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-2 control-label">*手机号：</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" name="phone" id="inputEmail3" placeholder="请输手机号">
							</div>
						</div>
						<!--备选号-->
						<div class="form-group">
							<label for="inputEmail3" class="col-sm-2 control-label">备选号：</label>
							<div class="col-sm-10">
								<input type="text" class="form-control"  name="alternative"id="inputEmail3" placeholder="备选号">
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="submit" class="btn btn-default">确定</button>
						<!--表单结束-->
				</form>

			</div>
		</div>
	</div>
</div>
<!--摸态框结束-->
<!--如果没有添加地址添加-->

	<?php if(!$addressData){?>
<h3 class="orde_main_add">
	                       请添加您的地址
	                <!-- Button trigger modal -->
	<a type="button"  data-toggle="modal" data-target="#myModal">
		&nbsp;&nbsp;[点击添加地址]
	</a>
</h3>
<?php }else{?>
<!--如果添加了订单-->
<!--地址显示页-->

<h3 class="orde_main_title">
	收货人信息
	<!-- Button trigger modal -->
	<a type="button"  data-toggle="modal" data-target="#myModal">
		&nbsp;&nbsp;[使用新的地址]
	</a>
</h3>
<div class="show_address">
	<!--表格显地址-->
	<table class="table table-hover AddCl">
		<foreach from="$addressData" value="$v">
		<tr >
			<td width="100">
				<i></i>
				<em></em>
			</td>
			<td width="100">
				<input type="radio" name="address"   class="address" value=""  />
				<label for="address">{{$v['ressName']}}</label>
			</td>
			<td class="contentAddress" rid="{{$v['rid']}}">
				<span>{{$v['bigRess']}} {{$v['detailRess']}}</span><span>收货人：{{$v['ressName']}}</span><span>电话:{{$v['phone']}}</span>
			</td>
			<td width="80">
				默认地址
			</td>
			<td width="50">
				<a href="{{u('delress',['rid'=>$v['rid']])}}" class="glyphicon glyphicon-remove"></a>
			</td>

		</tr>
	</foreach>
		<script>

			$('.address').click(function(){

				$(this).parents('tr').addClass('background');
				$(this).parents('tr').siblings('tr').removeClass('background');
				$(this).parents('.background').find('em').html("寄送至");
				$(this).parents('tr').siblings('tr').find('em').html('');
			})
		</script>
	</table>
</div>
<?php } ?>

<!--地址选择结束-->
<!--发票栏开始-->

<div class="orde_main_invoice">
	<ul>
		<!--纸质票-->
		<li class="">
			<div class="paper_invoice">
				<input type="radio" checked name="invoice" id="paper_invoice" value=""/>
				<label for="paper_invoice" checked>纸质发票</label>

			</div>
			<!--个人单位-->
			<div id="" class="invoice_item">
				<ul>
					<li>
						<input type="radio" checked name="item_invoice" id="personage" value=""/>
						<label for="personage">个人</label>
					</li>
					<li>
						<input type="radio" name="item_invoice" id="monad" value=""/>
						<label	for="monad">单位</label>
						<input type="text" name="" id="" value=""  placeholder="输入单位名称"/>
					</li>
				</ul>
			</div>
		</li>
		<!--电子发票-->
		<li class="">
			<div class="paper_invoice">
				<input type="radio" name="invoice" id="paper_invoice2" value=""/>
				<label for="paper_invoice2">电子发票</label>

			</div>
			<!--个人单位-->
			<div id="" class="invoice_item" style="display: none" >
				<ul>
					<li>
						<input type="radio" name="item_invoice" id="personage" value=""/>
						<label for="personage">个人</label>
					</li>
					<li>
						<b>什么是电子发票？</b>
						<ol>
							<br />
							<li>· 开具的电子发票均为真实有效的合法发票，与传统纸质发票具有同等法律效力，可作为用户保修的有效凭据。</li>
							<li>· 在用户确认收货，订单完成后开具电子发票</li>
							<li>· 您在订单详情可下载您的电子发票。<a href="">什么是电子发票？</a></li>
						</ol>
					</li>
				</ul>
			</div>
		</li>
	</ul>
</div>
<p><em>注意：</em> <span style="color: #FF6633;">如果商品由第三方卖家销售，发票内容由其卖家决定，发票由卖家开具并寄出</span></p>

<!--发票栏结束**88-->
<!--购买商品清单开始-->
<div class="commodity_list">
	<div class="commodity_list_content">
		<div class="commodity_list_content_content">
			<div class="commodity_list_content_content_title">
				<div class="commodity_list_content_content_title_top">
					以下商品由<b>商城</b>选择合作快递配送

				</div>
				<div class="commodity_list_content_content_title_top">
					<table class="table">
						<tr>
							<th>商品</th>
							<th width="112">单价（元）</th>
							<th width="120">数量</th>
							<th width="120">小计（元）</th>
						</tr>

					</table>
				</div>
				<foreach from="$data['goods']" value="$v">
				<div class="commodity_list_content_content_commodity_">
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="844">
								<ul>
									<li><a href="">{{$v['name']}} {{$v['options']['选择容量']}} {{$v['options']['选择制式']}}（{{$v['options']['颜色']}}）</a></li>

								</ul>
							</td>
							<td width="112">
								单价￥<b>{{$v['price']}}</b>
							</td>
							<td width="120" style="text-align: center;">
								数量{{$v['num']}}
							</td>
							<td width="120">

								小计￥<b>{{$v['total']}}</b>
							</td>

						</tr>

					</table>
				</div>
				</foreach>
			</div>

		</div>
		<!--商品列表结束-->
		<!--商品总开始-->
		<div class="list_content_Commodity_price">
			<div class="Commodity_price_left">

				<div class="order_ticket">
<!--					<input type="checkbox" name="" id="" value="" />-->
					使用优惠券
					<a href="">（了解优惠券使用规则）</a>
				</div>
				<div class="order_ticket">
<!--					<input type="checkbox" name="" id="" value="" />-->
					使用花瓣
					<a href="">（使用规则）</a>
					<a href="">(花瓣详情)</a>
				</div>

			</div>
			<!--右侧商品总价-->
			<div class="Commodity_price_right">
				<table class="table table">

					<tr>
						<td>商品总金额：</td>
						<td>￥<em>{{$data['anyTotal']}}</em></td>
					</tr>
					<tr>
						<td>运费：</td>
						<td>￥<em>0.00</em></td>
					</tr>

					<tr>
						<td>使用花瓣：</td>
						<td>-￥<em>0.00</em></td>
					</tr>
					<tr>
						<td>商家活动</td>
						<td>-￥<em>0.00</em></td>
					</tr>
				</table>
				<p><span>应付金额:</span><b>￥{{$data['anyTotal']}}</b></p>

			</div>

		</div>

	</div>

</div>
<!--底部递交订单-->
<div class="price_bottom">
	<span>应付金额：</span>
	<b> ￥{{$data['anyTotal']}}</b>
<!--	递交订单按钮-->
	<a class="ajaxStore" href="javascript:;">递交订单</a>
</div>
<!--异步发送地址信息-->
<!--.find('.address').text()-->
<script>

	$(function(){
//		发票点击显示隐藏
		$('.paper_invoice').click(function(){
			$(this).siblings('.invoice_item').show();
			$(this).parents('li').siblings('li').find('.invoice_item').hide();
		})
//		点击订交订单
		$('.ajaxStore').click(function(){

			var check=$(this).parents('.price_bottom').siblings('.show_address').find('tr');
			if(check.is('.background')){
				var rid;
				$.each(check,function(){
					if($(this).is('.background')){
						rid=$(this).find('.contentAddress').attr('rid');
					}
				});
			}else{
				alert('请选择地址');
				return false;
			}
			var data={
				rid:rid,
			}

			//			发送异步将值存入表中
			$.post("{{u('myCar.ajaxStore')}}",data,function(res){
				if(res.check==1){
					location.href='index.php'+'?s=home/mycar/successOrder&'+'oid='+res.oid;

				}else{
					alert('订单不存下，请重新选择商品');
					location.href='index.php';
					return false;
				}
			},'json');



		})
	})

</script>
</div>

<!--***********************子类继承结束*****************************-->
<div class="public_footer">
	<!--五百强企业退货开始-->
	<div class="public_footer_slogan">
		<ul>
			<li>
				<i></i> 500强企业 品质保证
			</li>
			<li>
				<i></i>7天退货 15天换货
			</li>
			<li>
				<i></i> 99元起免运费
			</li>
			<li>
				<i></i> 448家维修网点 全国联保
			</li>

		</ul>
	</div>

	<!--右侧定位点击回顶部-->
	<div class="Right_fixed">

		<a href="javascript:;" class="clickTop"></a>


	</div>


</div>

</body>

</html>